
	console.log("时间连接成功");
	
	function showTime()
	{
		let time = new Date(); //创建日期对象
		let y = time.getFullYear(); //把年份赋给Y
		let m = time.getMonth(); //把月份赋给m
		let d = time.getDate(); //把日期赋给d
		let z = time.getDay();//获取周几的数值
		let Hours = time.getHours(); //把小时赋给Hours
		let Minutes = time.getMinutes(); //把分钟赋给Minutes
		let Seconds = time.getSeconds(); //把秒钟赋给Seconds
		const show_time = document.getElementById("show_time"); //元素定位到show_time
		if(Hours < 10 ) //判断小时是否小于10小时
		{
			Hours =String("0") + Hours; //string() 为强制类型转换 
		}
		if(Minutes < 10 ) //判断分钟是否小于10分钟
		{
			Minutes = String("0") + Minutes;
		}
		if(Seconds < 10 ) //判断秒钟是否小于10秒钟
		{
			Seconds = String("0") + Seconds;
		}
		
		switch(z)
		{
			case 1:
			z = "一"
			break;
			case 2:
			z = "二"
			break;
			case 3:
			z = "三"
			break;
			case 4:
			z = "四"
			break;
			case 5:
			z = "五"
			break;
			case 6:
			z = "六";
			break;
			default:
			z = "日";
		}
		show_time.innerText = `${y}年${m+1}月${d}日 ${Hours}:${Minutes}:${Seconds} 星期${z}`;
	}
	setInterval(showTime,100);
	
